//
//  StaffBaseListTableViewCell.m
//  AppHelpStaff
//
//  Created by Zheng on 2018/7/10.
//  Copyright © 2018年 app.help.staff.zhengcx. All rights reserved.
//

#import "StaffBaseListTableViewCell.h"

@implementation StaffBaseListTableViewCell

#pragma mark - Subviews
#pragma amrk layout subviews
- (void)layoutSubviewsInView {
    [super layoutSubviewsInView];
 
    [_hotelLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.height.mas_equalTo(kScale(60));
        make.centerY.equalTo(self);
        make.left.mas_equalTo(kScale(12));
    }];
    
    [_titleLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(kScale(20));
        make.left.equalTo(_hotelLbl.mas_right).offset(kScale(12));
    }];
    
    [_needLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(_titleLbl.mas_bottom).offset(kScale(3));
        make.left.equalTo(_titleLbl);
    }];
    
    [_dateLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(_needLbl.mas_bottom).offset(kScale(3));
        make.left.equalTo(_titleLbl);
    }];
    
    [_addressLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(_dateLbl.mas_bottom).offset(kScale(3));
        make.left.equalTo(_titleLbl);
    }];
    
}

#pragma mark create subviews
- (void)createSubviews {
    [super createSubviews];
    
    [self.bgImgv addSubview:self.hotelLbl];
    [self.bgImgv addSubview:self.titleLbl];
    [self.bgImgv addSubview:self.needLbl];
    [self.bgImgv addSubview:self.dateLbl];
    [self.bgImgv addSubview:self.addressLbl];
}

- (UILabel *)hotelLbl {
    if (!_hotelLbl) {
        _hotelLbl = [[UILabel alloc] init];
        _hotelLbl.backgroundColor = kBlueColor;
        _hotelLbl.font = kBoldFont(15);
        _hotelLbl.text = @"XX\n酒店";
        _hotelLbl.textColor = kWhiteColor;
        _hotelLbl.textAlignment = NSTextAlignmentCenter;
        _hotelLbl.numberOfLines = 2;
        _hotelLbl.layer.cornerRadius = kScale(30);
        _hotelLbl.layer.masksToBounds = YES;
    }
    return _hotelLbl;
}

- (UILabel *)titleLbl {
    if (!_titleLbl) {
        _titleLbl = [[UILabel alloc] init];
        _titleLbl.font = kFont(12);
        _titleLbl.textColor = kFontBlueColor;
        _titleLbl.text = @"安保服务";
    }
    return _titleLbl;
}

- (UILabel *)needLbl {
    if (!_needLbl) {
        _needLbl = [[UILabel alloc] init];
        _needLbl.font = kFont(12);
        _needLbl.textColor = kFontBlueColor;
        _needLbl.text = @"还需5人";
    }
    return _needLbl;
}

- (UILabel *)dateLbl {
    if (!_dateLbl) {
        _dateLbl = [[UILabel alloc] init];
        _dateLbl.font = kFont(12);
        _dateLbl.textColor = kFontBlueColor;
        _dateLbl.text = @"18.06.14";
    }
    return _dateLbl;
}

- (UILabel *)addressLbl {
    if (!_addressLbl) {
        _addressLbl = [[UILabel alloc] init];
        _addressLbl.font = kFont(12);
        _addressLbl.textColor = kFontBlueColor;
        _addressLbl.text = @"北京市XX区XX大厦";
    }
    return _addressLbl;
}




@end
